package com.yyl.appx.adapter

import android.util.Log
import androidx.recyclerview.widget.DiffUtil

object DemoTest {
    val tag = "DemoTest"

    fun test(adapter: DiffUtilAdapter) {
        val newList = mutableListOf<DiffUtilDemoEntity>()
        newList.addAll(adapter.data.takeLast(2))
//        val entity= DiffUtilDemoEntity()
//        entity.content="111111111"
//        entity.title="222222222222"
        adapter.setDiffNewData(newList){
            Log.i(tag, "setDiffNewData")
        }
    }

    fun test2(){
        DiffUtil.calculateDiff(object : DiffUtil.Callback(){
            override fun getOldListSize(): Int {
                TODO("Not yet implemented")
            }

            override fun getNewListSize(): Int {
                TODO("Not yet implemented")
            }

            override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
                TODO("Not yet implemented")
            }

            override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
                TODO("Not yet implemented")
            }

        })
    }

}